BeginClone
The BeginClone method initiates a cloning transaction to transfer data from this draft to the specified destination draft.
ODDraftKey BeginClone (in ODDraft destDraft, in ODFrame destFrame, in ODCloneKind kind);
destDraft
- A reference to the destination draft to which objects are to be cloned.
destFrame
- A reference to the destination frame, or
kODNULL
if the clone operation is not a paste or a drop.kind
- The kind of clone operation being performed.
- return value
- The draft key for this cloning transaction.
DISCUSSION
TheBeginClone
method sets up a cloning transaction of the specified kind and returns a unique draft key that identifies the transaction. Other methods involved in cloning require you to supply this draft key as a parameter. The Bento container suite allows only one cloning transaction at any given time.The
destFrame
parameter allows OpenDoc to detect an attempt to move a part into one of its embedded frames. For pasting operations, thedestFrame
parameter should be set to the part's active frame. For dropping operations, this parameter should be set to the drop target frame. In all other cases, this parameter should be set to null.The
kind
parameter indicates the nature of the cloning operation required, such as copy object from source to clipboard (kODCloneCopy
), cut object from source to clipboard (kODCloneCut
), and so on. When performing a drop, a part must usekODCloneDropCopy
orkODCloneDropMove
; it should not use the clipboard clone kindkODClonePaste
.After calling this method, you call this draft object's
Clone
method to clone a particular persistent object. To commit a successful cloning transaction, call this draft object'sEndClone
method; before theEndClone
method has successfully executed, there is no guarantee that all the objects have been copied. If the cloning operation cannot be completed for any reason, you must terminate the transaction by calling this draft object'sAbortClone
method.EXCEPTIONS
kODErrCloningInProgress
- Another cloning process is in progress.
kODErrInconsistentCloneKind
- The specified clone kind is used inconsistently. For example, a paste or drop clone kind can occur only following a copy or cut operation.
kODErrInvalidCloneKind
- The specified clone kind is not valid.
kODErrInvalidDestinationDraft
- The specified destination draft is not valid for the specified clone kind.
SEE ALSO
TheODCloneKind
type (page 917).
TheODDraftKey
type (page 902).
TheODDraft::AbortClone
method (page 151).
TheODDraft::Clone
method (page 162).
TheODDraft::EndClone
method (page 171).
"BeginClone" on page 322 in OpenDoc Programmer's Guide.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help